﻿
$(document).ready(function () {
    $(".downloadWrapper").mouseenter(function () {
        if ($(".downloadLink") != null) {
            var path = $(this).find('input[name=path]');
            var downloadButton = "<div id='download' class='buttons downloadLink' style='float:right;display:none;'>" +
                                 "<a style='padding:0;' href='" + path.val() + "'><button  type='submit' class='regular' name='save' onclick='window.location.href(\"" + path.val() + "\")' ><img src='/Images/Icons/Download.png' alt='' /> Download</button></a></div>";

            $(this).append(downloadButton);
            $(this).css('padding-bottom', '15px');
            $("#download").slideDown();
        }
    });

    $(".downloadWrapper").mouseleave(function () {
        $(".downloadLink").remove();
        $(this).css('padding-bottom', '5px');
    });
});
